home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Technology Seed / Mac Tech Seed Feb '96 / Mac Tech Seed Feb '96.toast / mac / Unicode Converter A15 / Headers / Unicode.p < prev   
Encoding:
Text File  |  1995-11-15  |  18.0 KB  |  503 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Unicode.p
  3.  
  4.      Contains:    Unicode Interfaces.
  5.  
  6.      Version:    ETO
  7.  
  8.      DRI:        ulio Gonzalez
  9.  
  10.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Warning:    *** APPLE INTERNAL USE ONLY ***
  14.                  This file may contain unreleased API's
  15.  
  16.      BuildInfo:    Built by:            Sue Kuo
  17.                  With Interfacer:    1.1d13  
  18.                  From:                Unicode.i
  19.                      Revision:        34
  20.                      Dated:            11/13/95
  21.                      Last change by:    PKE
  22.                      Last comment:    #1301570: Rename kUnicodeUCS2Format to kISO10646UCS2Format,
  23.  
  24.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. }
  28.  
  29. {$IFC UNDEFINED UsingIncludes}
  30. {$SETC UsingIncludes := 0}
  31. {$ENDC}
  32.  
  33. {$IFC NOT UsingIncludes}
  34.  UNIT Unicode;
  35.  INTERFACE
  36. {$ENDC}
  37.  
  38. {$IFC UNDEFINED __UNICODE__}
  39. {$SETC __UNICODE__ := 1}
  40.  
  41. {$I+}
  42. {$SETC UnicodeIncludes := UsingIncludes}
  43. {$SETC UsingIncludes := 1}
  44.  
  45.  
  46. {$IFC UNDEFINED __TYPES__}
  47. {$I Types.p}
  48. {$ENDC}
  49. {    ConditionalMacros.p                                            }
  50.  
  51. {$IFC UNDEFINED __MIXEDMODE__}
  52. {$I MixedMode.p}
  53. {$ENDC}
  54.  
  55. {$PUSH}
  56. {$ALIGN MAC68K}
  57. {$LibExport+}
  58.     
  59. TYPE
  60.     BytePtr = ^UInt8;
  61.  
  62.     ByteCount = UInt32;
  63.  
  64.     ItemCount = UInt32;
  65.  
  66.     OptionBits = UInt32;
  67.  
  68.     RegionCode = INTEGER;
  69.  
  70.     ByteOffset = UInt32;
  71.  
  72.     ConstLogicalAddress = LogicalAddress;
  73.  
  74. {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE }
  75.  
  76. CONST
  77.     unicodeChecksumErr            = -8769;
  78.     unicodeNoTableErr            = -8768;
  79.     unicodeVariantErr            = -8767;
  80.     unicodeFallbacksErr            = -8766;
  81.     unicodePartConvertErr        = -8765;
  82.     unicodeBufErr                = -8764;
  83.     unicodeCharErr                = -8763;
  84.     unicodeElementErr            = -8762;
  85.     unicodeNotFoundErr            = -8761;
  86.     unicodeTableFormatErr        = -8760;
  87.     unicodeDirectionErr            = -8759;
  88.     unicodeContextualErr        = -8758;
  89.     unicodeTextEncodingDataErr    = -8757;
  90.  
  91. { Unicode Converter Gestalt Constants: (••••these belong in Gestalt.i••••) }
  92.     gestaltUnicodeAttr            = 'unic';
  93.     gestaltUnicodeConverterPresent = 0;
  94.     gestaltUnicodeConverterMask    = 1 * (2**(gestaltUnicodeConverterPresent));
  95.  
  96. { Basic types for Unicode characters and strings: }
  97.     
  98. TYPE
  99.     UniCharArrayPtr = ^UniChar;
  100.  
  101.     ConstUniCharArrayPtr = ^UniChar;
  102.  
  103. { Unicode conversion contexts: }
  104.     TextToUnicodeInfo = Ptr;
  105.  
  106.     ConstTextToUnicodeInfo = Ptr;
  107.  
  108.     UnicodeToTextInfo = Ptr;
  109.  
  110.     ConstUnicodeToTextInfo = Ptr;
  111.  
  112.     UnicodeToTextRunInfo = Ptr;
  113.  
  114.     TextEncodingBase = UInt32;
  115.  
  116.  
  117. CONST
  118. { Mac OS encodings}
  119.     kTextEncodingMacRoman        = 0;
  120.     kTextEncodingMacJapanese    = 1;
  121.     kTextEncodingMacTradChinese    = 2;
  122.     kTextEncodingMacKorean        = 3;
  123.     kTextEncodingMacArabic        = 4;
  124.     kTextEncodingMacHebrew        = 5;
  125.     kTextEncodingMacGreek        = 6;
  126.     kTextEncodingMacCyrillic    = 7;
  127.     kTextEncodingMacRSymbol        = 8;
  128.     kTextEncodingMacDevanagari    = 9;
  129.     kTextEncodingMacGurmukhi    = 10;
  130.     kTextEncodingMacGujarati    = 11;
  131.     kTextEncodingMacOriya        = 12;
  132.     kTextEncodingMacBengali        = 13;
  133.     kTextEncodingMacTamil        = 14;
  134.     kTextEncodingMacTelugu        = 15;
  135.     kTextEncodingMacKannada        = 16;
  136.     kTextEncodingMacMalayalam    = 17;
  137.     kTextEncodingMacSinhalese    = 18;
  138.     kTextEncodingMacBurmese        = 19;
  139.     kTextEncodingMacKhmer        = 20;
  140.     kTextEncodingMacThai        = 21;
  141.     kTextEncodingMacLaotian        = 22;
  142.     kTextEncodingMacGeorgian    = 23;
  143.     kTextEncodingMacArmenian    = 24;
  144.     kTextEncodingMacSimpChinese    = 25;
  145.     kTextEncodingMacTibetan        = 26;
  146.     kTextEncodingMacMongolian    = 27;
  147.     kTextEncodingMacGeez        = 28;
  148.     kTextEncodingMacEastEurRoman = 29;
  149.     kTextEncodingMacCentralEurRoman = 29;
  150.     kTextEncodingMacVietnamese    = 30;
  151.     kTextEncodingMacExtArabic    = 31;
  152.     kTextEncodingMacUninterp    = 32;
  153.     kTextEncodingMacSymbol        = 33;
  154.     kTextEncodingMacDingbats    = 34;
  155.     kTextEncodingMacTurkish        = 35;
  156.     kTextEncodingMacCroatian    = 36;
  157.     kTextEncodingMacIcelandic    = 37;
  158.     kTextEncodingMacRomanian    = 38;
  159.     kTextEncodingMacUkrainian    = 152;
  160.     kTextEncodingMacBulgarian    = 153;
  161.     kTextEncodingMacHFS            = $FF;                            { Meta-value, should never appear in a table.}
  162. { Unicode encodings begin at 0x100}
  163.     kTextEncodingUnicodeDefault    = $100;                            { Meta-value, should never appear in a table.}
  164.     kTextEncodingUnicodeV1_1    = $101;
  165.     kTextEncodingISO10646_1993    = $102;                            { can have UCS4 format (Unicode can't)}
  166. { Windows & MS-DOS encodings begin at 0x200}
  167.     kTextEncodingWindowsLatin1    = $200;                            { code page 1252}
  168.     kTextEncodingWindowsANSI    = $200;                            { code page 1252 (alternate name)}
  169.     kTextEncodingWindowsLatin2    = $201;                            { code page 1250, Central Europe}
  170.     kTextEncodingWindowsCyrillic = $202;                        { code page 1251, Slavic Cyrillic}
  171.     kTextEncodingWindowsGreek    = $203;                            { code page 1253}
  172.     kTextEncodingWindowsLatin5    = $204;                            { code page 1254, Turkish}
  173.     kTextEncodingWindowsHebrew    = $205;                            { code page 1255}
  174.     kTextEncodingWindowsArabic    = $206;                            { code page 1256}
  175.     kTextEncodingWindowsBalticRim = $207;                        { code page 1257}
  176.     kTextEncodingDOSLatinUS        = $300;                            { code page 437}
  177.     kTextEncodingDOSRoman        = $300;                            { code page 437 (alternate name, will go away soon)}
  178.     kTextEncodingDOSArabicASMO    = $301;                            { code page 708 (ASMO 708)}
  179.     kTextEncodingDOSGreek        = $305;                            { code page 737 (formerly code page 437G)}
  180.     kTextEncodingDOSBalticRim    = $306;                            { code page 775}
  181.     kTextEncodingDOSLatin1        = $310;                            { code page 850, "Multilingual"}
  182.     kTextEncodingDOSGreek1        = $311;                            { code page 851}
  183.     kTextEncodingDOSLatin2        = $312;                            { code page 852, Slavic}
  184.     kTextEncodingDOSCyrillic    = $313;                            { code page 855, IBM Cyrillic}
  185.     kTextEncodingDOSTurkish        = $314;                            { code page 857, IBM Turkish}
  186.     kTextEncodingDOSPortuguese    = $315;                            { code page 860}
  187.     kTextEncodingDOSIcelandic    = $316;                            { code page 861}
  188.     kTextEncodingDOSHebrew        = $317;                            { code page 862}
  189.     kTextEncodingDOSCanadianFrench = $318;                        { code page 863}
  190.     kTextEncodingDOSArabic        = $319;                            { code page 864}
  191.     kTextEncodingDOSNordic        = $31A;                            { code page 865}
  192.     kTextEncodingDOSRussian        = $31B;                            { code page 866}
  193.     kTextEncodingDOSGreek2        = $31C;                            { code page 869, IBM Modern Greek}
  194.     kTextEncodingDOSThai        = $31D;                            { code page 874, also used for Windows}
  195.     kTextEncodingDOSJapanese    = $320;                            { code page 932, also used for Windows}
  196.     kTextEncodingDOSChineseSimplif = $321;                        { code page 936, also used for Windows}
  197.     kTextEncodingDOSKorean        = $322;                            { code page 949, also used for Windows}
  198.     kTextEncodingDOSChineseTrad    = $323;                            { code page 950, also used for Windows}
  199. { Other ISO encodings begin at 0x800}
  200.     kTextEncodingISOLatin1        = $801;                            { ISO 8859-1}
  201.     kTextEncodingISOLatin2        = $802;                            { ISO 8859-2}
  202.     kTextEncodingISOLatinCyrillic = $805;                        { ISO 8859-5}
  203.     kTextEncodingISOLatinArabic    = $806;                            { ISO 8859-6}
  204.     kTextEncodingISOLatinGreek    = $807;                            { ISO 8859-7}
  205.     kTextEncodingISOLatinHebrew    = $808;                            { ISO 8859-8}
  206.     kTextEncodingISOLatin5        = $809;                            { ISO 8859-9}
  207.  
  208. { TextEncodingVariant type & values }
  209.     
  210. TYPE
  211.     TextEncodingVariant = UInt32;
  212.  
  213.  
  214. CONST
  215. { Default TextEncodingVariant, for any TextEncodingBase}
  216.     kTextEncodingDefaultVariant    = 0;
  217. { Variants of kTextEncodingMacJapanese}
  218.     kJapaneseStandardVariant    = 0;
  219.     kJapaneseStdNoVerticalsVariant = 1;
  220.     kJapaneseBasicVariant        = 2;
  221.     kJapanesePostScriptScrnVariant = 3;
  222.     kJapanesePostScriptPrintVariant = 4;
  223.     kJapaneseVertAtKuPlusTenVariant = 5;
  224. { Variants of kTextEncodingMacHebrew}
  225.     kHebrewStandardVariant        = 0;
  226.     kHebrewFigureSpaceVariant    = 1;
  227. { Variants of kTextEncodingUnicodeV1_1}
  228.     kUnicodeNoSubset            = 0;
  229.     kUnicodeNoCompatibilityVariant = 1;
  230.     kUnicodeMaxDecomposedVariant = 2;
  231.     kUnicodeNoComposedVariant    = 3;
  232.  
  233. { TextEncodingFormat type & values }
  234.     
  235. TYPE
  236.     TextEncodingFormat = UInt32;
  237.  
  238.  
  239. CONST
  240. { Default TextEncodingFormat for Any TextEncodingBase}
  241.     kTextEncodingDefaultFormat    = 0;
  242. { Formats for kTextEncodingUnicodeV1_1}
  243.     kUnicode16BitFormat            = 0;
  244. { Formats for kTextEncodingISO10646_1993}
  245.     kISO10646UCS2Format            = 0;
  246.  
  247. { TextEncoding type & values }
  248.     
  249. TYPE
  250.     TextEncoding = UInt32;
  251.  
  252.  
  253. CONST
  254. { TextEncoding used by HFS}
  255.     kMacHFSTextEncoding            = $000000FF;
  256.  
  257. { UnicodeMapVersion type & values }
  258.     
  259. TYPE
  260.     UnicodeMapVersion = SInt32;
  261.  
  262.  
  263. CONST
  264.     kUnicodeUseLatestMapping    = -1;
  265.  
  266. { Types used in conversion }
  267.     
  268. TYPE
  269.     UnicodeMappingPtr = ^UnicodeMapping;
  270.  
  271.     ConstUnicodeMappingPtr = ^UnicodeMapping;
  272.  
  273.     UnicodeMapping = RECORD
  274.         unicodeEncoding:        TextEncoding;
  275.         otherEncoding:            TextEncoding;
  276.         mappingVersion:            UnicodeMapVersion;
  277.     END;
  278.  
  279.     TextEncodingRun = RECORD
  280.         offset:                    ByteOffset;
  281.         textEncoding:            TextEncoding;
  282.     END;
  283.  
  284. { Control flags for ConvertUnicodeToText and ConvertTextToUnicode }
  285.  
  286. CONST
  287.     kUnicodeUseFallbacksBit        = 0;
  288.     kUnicodeKeepInfoBit            = 1;
  289.     kUnicodeDirectionalityBits    = 2;
  290.     kUnicodeVerticalFormBit        = 4;
  291.     kUnicodeLooseMappingsBit    = 5;
  292.     kUnicodeStringUnterminatedBit = 6;
  293.     kUnicodeTextRunBit            = 7;
  294.     kUnicodeKeepSameEncodingBit    = 8;
  295.  
  296.     kUnicodeUseFallbacksMask    = 1 * (2**(kUnicodeUseFallbacksBit));
  297.     kUnicodeKeepInfoMask        = 1 * (2**(kUnicodeKeepInfoBit));
  298.     kUnicodeDirectionalityMask    = 3 * (2**(kUnicodeDirectionalityBits));
  299.     kUnicodeVerticalFormMask    = 1 * (2**(kUnicodeVerticalFormBit));
  300.     kUnicodeLooseMappingsMask    = 1 * (2**(kUnicodeLooseMappingsBit));
  301.     kUnicodeStringUnterminatedMask = 1 * (2**(kUnicodeStringUnterminatedBit));
  302.     kUnicodeTextRunMask            = 1 * (2**(kUnicodeTextRunBit));
  303.     kUnicodeKeepSameEncodingMask = 1 * (2**(kUnicodeKeepSameEncodingBit));
  304.  
  305. { Values for kUnicodeDirectionality field }
  306.     kUnicodeDefaultDirection    = 0;
  307.     kUnicodeLeftToRight            = 1;
  308.     kUnicodeRightToLeft            = 2;
  309.  
  310. { Control flags for TruncateForUnicodeToText: }
  311.     kUnicodeTextElementSafeBit    = 0;
  312.     kUnicodeRestartSafeBit        = 1;
  313.  
  314.     kUnicodeTextElementSafeMask    = 1 * (2**(kUnicodeTextElementSafeBit));
  315.     kUnicodeRestartSafeMask        = 1 * (2**(kUnicodeRestartSafeBit));
  316.  
  317. { Filter bits for QueryUnicodeMappings filter field: }
  318.     kUnicodeMatchUnicodeBaseBit    = 0;
  319.     kUnicodeMatchUnicodeVariantBit = 1;
  320.     kUnicodeMatchUnicodeFormatBit = 2;
  321.     kUnicodeMatchOtherBaseBit    = 3;
  322.     kUnicodeMatchOtherVariantBit = 4;
  323.     kUnicodeMatchOtherFormatBit    = 5;
  324.  
  325.     kUnicodeMatchUnicodeBaseMask = 1 * (2**(kUnicodeMatchUnicodeBaseBit));
  326.     kUnicodeMatchUnicodeVariantMask = 1 * (2**(kUnicodeMatchUnicodeVariantBit));
  327.     kUnicodeMatchUnicodeFormatMask = 1 * (2**(kUnicodeMatchUnicodeFormatBit));
  328.     kUnicodeMatchOtherBaseMask    = 1 * (2**(kUnicodeMatchOtherBaseBit));
  329.     kUnicodeMatchOtherVariantMask = 1 * (2**(kUnicodeMatchOtherVariantBit));
  330.     kUnicodeMatchOtherFormatMask = 1 * (2**(kUnicodeMatchOtherFormatBit));
  331.  
  332. { enums for TextEncoding Conversion routines }
  333.     kUnicodeScriptDontCare        = -128;
  334.     kUnicodeLanguageDontCare    = -128;
  335.     kUnicodeRegionDontCare        = -128;
  336.  
  337. { Control flags for SetFallbackUnicodeToText }
  338.     kUnicodeFallbackSequencingBits = 0;
  339.  
  340.     kUnicodeFallbackSequencingMask = 3 * (2**(kUnicodeFallbackSequencingBits));
  341.  
  342. { values for kUnicodeFallbackSequencing field }
  343.     kUnicodeFallbackDefaultOnly    = 0;
  344.     kUnicodeFallbackCustomOnly    = 1;
  345.     kUnicodeFallbackDefaultFirst = 2;
  346.     kUnicodeFallbackCustomFirst    = 3;
  347.  
  348. {$ENDC}
  349. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  350. TYPE
  351.     UnicodeToTextFallbackProcPtr = ProcPtr;  { FUNCTION UnicodeToTextFallback(VAR srcUniStr: UniChar; srcUniStrLen: ByteCount; VAR srcConvLen: ByteCount; destStr: BytePtr; destStrLen: ByteCount; VAR destConvLen: ByteCount; contextPtr: LogicalAddress): OSStatus; }
  352.     UnicodeToTextFallbackUPP = UniversalProcPtr;
  353.  
  354. CONST
  355.     uppUnicodeToTextFallbackProcInfo = $000FFFF0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param, 4 byte param): 4 byte result; }
  356.  
  357. FUNCTION NewUnicodeToTextFallbackProc(userRoutine: UnicodeToTextFallbackProcPtr): UnicodeToTextFallbackUPP;
  358.     {$IFC NOT GENERATINGCFM }
  359.     INLINE $2E9F;
  360.     {$ENDC}
  361.  
  362. FUNCTION CallUnicodeToTextFallbackProc(VAR srcUniStr: UniChar; srcUniStrLen: ByteCount; VAR srcConvLen: ByteCount; destStr: BytePtr; destStrLen: ByteCount; VAR destConvLen: ByteCount; contextPtr: LogicalAddress; userRoutine: UnicodeToTextFallbackUPP): OSStatus;
  363.     {$IFC NOT GENERATINGCFM}
  364.     INLINE $205F, $4E90;
  365.     {$ENDC}
  366. {$ENDC}
  367. {$IFC FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE }
  368.  
  369. FUNCTION CreateTextEncoding(encodingBase: TextEncodingBase; encodingVariant: TextEncodingVariant; encodingFormat: TextEncodingFormat): TextEncoding;
  370.     {$IFC NOT GENERATINGCFM}
  371.     INLINE $303C, $0615, $ABCE;
  372.     {$ENDC}
  373. { Retrieve TextEncodingBase from TextEncoding }
  374. FUNCTION GetTextEncodingBase(encoding: TextEncoding): TextEncodingBase;
  375.     {$IFC NOT GENERATINGCFM}
  376.     INLINE $303C, $0216, $ABCE;
  377.     {$ENDC}
  378. { Retrieve TextEncodingVariant from TextEncoding }
  379. FUNCTION GetTextEncodingVariant(encoding: TextEncoding): TextEncodingVariant;
  380.     {$IFC NOT GENERATINGCFM}
  381.     INLINE $303C, $0217, $ABCE;
  382.     {$ENDC}
  383. { Retrieve TextEncodingFormat from TextEncoding }
  384. FUNCTION GetTextEncodingFormat(encoding: TextEncoding): TextEncodingFormat;
  385.     {$IFC NOT GENERATINGCFM}
  386.     INLINE $303C, $0218, $ABCE;
  387.     {$ENDC}
  388. { Create a new TextToUnicodeInfo structure. }
  389. FUNCTION CreateTextToUnicodeInfo(UnicodeMapping: ConstUnicodeMappingPtr; VAR textToUnicodeInfo: TextToUnicodeInfo): OSStatus;
  390.     {$IFC NOT GENERATINGCFM}
  391.     INLINE $303C, $0401, $ABCE;
  392.     {$ENDC}
  393. { Create a new UnicodeToTextInfo structure. }
  394. FUNCTION CreateUnicodeToTextInfo(UnicodeMapping: ConstUnicodeMappingPtr; VAR unicodeToTextInfo: UnicodeToTextInfo): OSStatus;
  395.     {$IFC NOT GENERATINGCFM}
  396.     INLINE $303C, $040C, $ABCE;
  397.     {$ENDC}
  398. FUNCTION CreateUnicodeToTextRunInfo(numberOfMappings: ItemCount; UnicodeMapping: ConstUnicodeMappingPtr; VAR unicodeToTextInfo: UnicodeToTextRunInfo): OSStatus;
  399.     {$IFC NOT GENERATINGCFM}
  400.     INLINE $303C, $0612, $ABCE;
  401.     {$ENDC}
  402. { Dispose of a TextToUnicodeInfo structure. }
  403. FUNCTION DisposeTextToUnicodeInfo(VAR textToUnicodeInfo: TextToUnicodeInfo): OSStatus;
  404.     {$IFC NOT GENERATINGCFM}
  405.     INLINE $303C, $0202, $ABCE;
  406.     {$ENDC}
  407. { Dispose of a UnicodeToTextInfo structure. }
  408. FUNCTION DisposeUnicodeToTextInfo(VAR unicodeToTextInfo: UnicodeToTextInfo): OSStatus;
  409.     {$IFC NOT GENERATINGCFM}
  410.     INLINE $303C, $020D, $ABCE;
  411.     {$ENDC}
  412. FUNCTION DisposeUnicodeToTextRunInfo(VAR unicodeToTextInfo: UnicodeToTextRunInfo): OSStatus;
  413.     {$IFC NOT GENERATINGCFM}
  414.     INLINE $303C, $0213, $ABCE;
  415.     {$ENDC}
  416. { Convert a string to Unicode. }
  417. FUNCTION ConvertTextToUnicode(textToUnicodeInfo: TextToUnicodeInfo; sourceLen: ByteCount; sourceStr: ConstLogicalAddress; controlFlags: OptionBits; offsetCount: ItemCount; VAR offsetArray: ByteOffset; bufLen: ByteCount; VAR sourceRead: ByteCount; VAR unicodeLen: ByteCount; unicodeStr: UniCharArrayPtr): OSStatus;
  418.     {$IFC NOT GENERATINGCFM}
  419.     INLINE $303C, $1404, $ABCE;
  420.     {$ENDC}
  421. { Convert a string from Unicode. }
  422. FUNCTION ConvertUnicodeToText(unicodeToTextInfo: UnicodeToTextInfo; unicodeLen: ByteCount; unicodeStr: ConstUniCharArrayPtr; controlFlags: OptionBits; offsetCount: ItemCount; VAR offsetArray: ByteOffset; bufLen: ByteCount; VAR inputRead: ByteCount; VAR outputLen: ByteCount; outputStr: LogicalAddress): OSStatus;
  423.     {$IFC NOT GENERATINGCFM}
  424.     INLINE $303C, $1403, $ABCE;
  425.     {$ENDC}
  426. FUNCTION ConvertUnicodeToTextRun(unicodeToTextInfo: UnicodeToTextRunInfo; unicodeLen: ByteCount; unicodeStr: ConstUniCharArrayPtr; controlFlags: OptionBits; offsetCount: ItemCount; VAR offsetArray: ByteOffset; bufLen: ByteCount; VAR inputRead: ByteCount; VAR outputLen: ByteCount; outputStr: LogicalAddress; encodingRunBufLen: ItemCount; VAR encodingRunOutLen: ItemCount; VAR encodingRuns: TextEncodingRun): OSStatus;
  427.     {$IFC NOT GENERATINGCFM}
  428.     INLINE $303C, $1A14, $ABCE;
  429.     {$ENDC}
  430. { Truncate a multibyte string at a safe place. }
  431. FUNCTION TruncateForTextToUnicode(textToUnicodeInfo: ConstTextToUnicodeInfo; sourceLen: ByteCount; sourceStr: ConstLogicalAddress; maxLen: ByteCount; VAR truncatedLen: ByteCount): OSStatus;
  432.     {$IFC NOT GENERATINGCFM}
  433.     INLINE $303C, $0A06, $ABCE;
  434.     {$ENDC}
  435. { Truncate a Unicode string at a safe place. }
  436. FUNCTION TruncateForUnicodeToText(unicodeToTextInfo: ConstUnicodeToTextInfo; sourceLen: ByteCount; sourceStr: ConstUniCharArrayPtr; controlFlags: OptionBits; maxLen: ByteCount; VAR truncatedLen: ByteCount): OSStatus;
  437.     {$IFC NOT GENERATINGCFM}
  438.     INLINE $303C, $0C05, $ABCE;
  439.     {$ENDC}
  440. { Convert a Pascal string to Unicode. }
  441. FUNCTION ConvertPStringToUnicode(textToUnicodeInfo: TextToUnicodeInfo; pascalStr: ConstStr255Param; bufLen: ByteCount; VAR unicodeLen: ByteCount; unicodeStr: UniCharArrayPtr): OSStatus;
  442.     {$IFC NOT GENERATINGCFM}
  443.     INLINE $303C, $0A08, $ABCE;
  444.     {$ENDC}
  445. { Convert a Unicode string to Pascal. }
  446. FUNCTION ConvertUnicodeToPString(unicodeToTextInfo: UnicodeToTextInfo; unicodeLen: ByteCount; unicodeStr: ConstUniCharArrayPtr; VAR pascalStr: Str255): OSStatus;
  447.     {$IFC NOT GENERATINGCFM}
  448.     INLINE $303C, $0807, $ABCE;
  449.     {$ENDC}
  450. { Get a list of the available conversion mappings. }
  451. FUNCTION QueryUnicodeMappings(filter: OptionBits; findMapping: UnicodeMappingPtr; maxCount: ItemCount; VAR actualCount: ItemCount; returnedMappings: UnicodeMappingPtr): OSStatus;
  452.     {$IFC NOT GENERATINGCFM}
  453.     INLINE $303C, $0A09, $ABCE;
  454.     {$ENDC}
  455. { Get the name of a TextEncodingBase table. }
  456. FUNCTION GetTextEncodingBaseName(UnicodeMapping: ConstUnicodeMappingPtr; languageID: LangCode; bufLen: ByteCount; VAR nameLength: ByteCount; mappingName: UniCharArrayPtr): OSStatus;
  457.     {$IFC NOT GENERATINGCFM}
  458.     INLINE $303C, $090A, $ABCE;
  459.     {$ENDC}
  460. { Change the TextToUnicodeInfo to another mapping. }
  461. FUNCTION ChangeTextToUnicodeInfo(textToUnicodeInfo: TextToUnicodeInfo; UnicodeMapping: ConstUnicodeMappingPtr): OSStatus;
  462.     {$IFC NOT GENERATINGCFM}
  463.     INLINE $303C, $040B, $ABCE;
  464.     {$ENDC}
  465. { Change the UnicodeToTextInfo to another mapping. }
  466. FUNCTION ChangeUnicodeToTextInfo(unicodeToTextInfo: UnicodeToTextInfo; UnicodeMapping: ConstUnicodeMappingPtr): OSStatus;
  467.     {$IFC NOT GENERATINGCFM}
  468.     INLINE $303C, $040E, $ABCE;
  469.     {$ENDC}
  470. {$ENDC}
  471. {$IFC FOR_SYSTEM8_PREEMPTIVE }
  472. {$ENDC}
  473. {$IFC FOR_SYSTEM7_ONLY }
  474.  
  475. FUNCTION SetFallbackUnicodeToText(unicodeToTextInfo: UnicodeToTextInfo; fallback: UnicodeToTextFallbackUPP; controlFlags: OptionBits; infoPtr: LogicalAddress): OSStatus;
  476.     {$IFC NOT GENERATINGCFM}
  477.     INLINE $303C, $080F, $ABCE;
  478.     {$ENDC}
  479. {$ENDC}
  480. {$IFC FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE }
  481.  
  482. FUNCTION UpgradeScriptInfoToTextEncoding(textScriptID: ScriptCode; textLanguageID: LangCode; regionID: RegionCode; textFontname: ConstStr255Param; VAR encoding: TextEncoding): OSStatus;
  483.     {$IFC NOT GENERATINGCFM}
  484.     INLINE $303C, $0710, $ABCE;
  485.     {$ENDC}
  486. { Convert a TextEncoding to script, language (if possible) and fontname (if necessary; for Symbol & Dingbats only ) }
  487. FUNCTION RevertTextEncodingToScriptInfo(encoding: TextEncoding; VAR textScriptID: ScriptCode; VAR textLanguageID: LangCode; VAR textFontname: Str255): OSStatus;
  488.     {$IFC NOT GENERATINGCFM}
  489.     INLINE $303C, $0811, $ABCE;
  490.     {$ENDC}
  491. {$ENDC}
  492.  
  493. {$ALIGN RESET}
  494. {$POP}
  495.  
  496. {$SETC UsingIncludes := UnicodeIncludes}
  497.  
  498. {$ENDC} {__UNICODE__}
  499.  
  500. {$IFC NOT UsingIncludes}
  501.  END.
  502. {$ENDC}
  503.